package com.example.demo.springboot.config;

import com.example.demo.springboot.component.JavamailComponent;
import com.example.demo.springboot.dao.UserDao;
import com.example.demo.springboot.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

@Configuration
@ComponentScan(basePackages = "com.example.demo.springboot")
public class UserConfiguration {


    @Value("spring.activemq.broker-url")
    private String jdbcUrl;

    @Bean
    public User getUser(){
        User user = new User();
        user.setPassowrd(jdbcUrl);
        return new User();
    }

    @Bean
    public UserDao getUserDao(){
        return new UserDao();
    }

    @Bean
    public String getJdbcUrl(){
        return this.jdbcUrl;
    }

}
